export default async (ctx, next) => {
  const { title, download, type } = ctx.request.body;
  let createTime = new Date().getTime() + '';
  let userid = ctx.info.userid
  let res = await ctx.db.insert('templates', { title, download, type, createTime, userid })
  if (res.affectedRows === 1) {
    ctx.body = { code: 1, msg: '提交成功' }
    return
  }
  ctx.body = { code: 0, mag: '提交失败,请重新提交' }
}